package com.clarence.dada.modular.system.app.entity.req;


import com.clarence.dada.core.base.BaseReq;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 系统应用参数
 *
 * @author GD
 * @since 2020/3/24 20:53
 */
@Data
@Schema(title = "系统应用请求实例")
@EqualsAndHashCode(callSuper = true)
public class SysAppReq extends BaseReq {

    /**
     * 主键
     */
    @NotNull(message = "应用主键不能为空", groups = {edit.class, delete.class, detail.class, appSetTop.class, updateStatus.class})
    @Schema(title = "主键", example = "1")
    private Long appId;

    /**
     * 名称
     */
    @NotBlank(message = "名称不能为空", groups = {add.class, edit.class})
    @Schema(title = "名称不能为空", example = "系统")
    private String appName;

    /**
     * 编码
     */
    @NotBlank(message = "编码不能为空", groups = {add.class, edit.class})
    @Schema(title = "应用编码", example = "system")
    private String appCode;

    /**
     * 应用图标
     */
    @NotBlank(message = "应用图标不能为空", groups = {add.class, edit.class})
    @Schema(title = "应用图标", example = "abc.svg")
    private String appIcon;

    /**
     * 是否置顶：Y-是，N-否，激活的应用下的菜单会在首页默认展开
     */
    @Schema(title = "是否置顶：Y-是，N-否，激活的应用下的菜单会在首页默认展开", example = "Y")
    private String topFlag;

    /**
     * 状态：1-启用，2-禁用
     */
    @NotNull(message = "状态为空", groups = {updateStatus.class})
    @Schema(title = "状态：1-启用，2-禁用", example = "1")
    private Integer statusFlag;

    /**
     * 排序-升序
     */
    @Schema(title = "排序-升序", example = "1")
    private Integer appSort;

    /**
     * 设置为默认状态
     */
    public @interface appSetTop {
    }

}
